<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>空气质量</title>		
		<meta http-equiv="Access-Control-Allow-Origin" content="">
		<meta http-equiv="content-security-policy">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />		
		<link href="mui/css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="styles/public.css" />
		<script src="mui/js/mui.js"  type="text/javascript"  charset="UTF-8"></script>		
	</head>
	<body>
		<!-- 主页面容器 -->
		<div class="mui-inner-wrap">
			<!-- 主页面标题 -->
	 		<header class="mui-bar mui-bar-nav">
	 			<a class="mui-icon mui-icon-back mui-pull-left mui-action-back"></a>	 			
	 			<h1 class="mui-title">赣州市空气质量</h1>
	 		</header>
	 		<!--描述：底部选项卡 -->
			<nav class="mui-bar mui-bar-tab" id="footer">				
				<a class="mui-tab-item mui-active" href="index.html" title="首页">
					<span class="mui-icon fico0"></span>
					<span class="mui-tab-label">首页</span>
				</a>
				<a id="tab2" class="mui-tab-item" href="list.html?categoryID=2" title="工作动态">
					<span class="mui-icon fico5"></span>
					<span class="mui-tab-label">工作动态</span>
				</a>
				<a class="mui-tab-item" href="list.html?categoryID=50" title="办事指南">
					<span class="mui-icon fico2"></span>
					<span class="mui-tab-label">办事指南</span>
				</a>				
				<a class="mui-tab-item" href="list.html?categoryID=60" title="行政概况">
					<span class="mui-icon fico4"></span>
					<span class="mui-tab-label">行政概况</span>
				</a>
			</nav>		
			<div class="mui-content">
				<div id="aqicontent" class="mui-scroll" >	
                   	<div class="AQIDiv">
                   		<a id="AQIValue"></a>
                   		<label>AQI</label>
                   		<span class="bi_aqiarea_wuran" id="quality_level"></span>
                   	</div>                   
                   	<div class="tips">
                   		<!--<p>温馨提示：<span id="advice"></span></p>
                   		<p>更新时间：<span id="updateTime"></span></p>-->
                   	</div> 
                   	<div class="aqiFooter">
                   		<p>首要污染物：<span id="wuranwu"></span></p>
                   		<p>温馨提示：<span id="advice"></span></p>
                   		<p>更新时间：<span id="updateTime"></span></p>                   		
                   	</div>
               </div>                
			</div>
		</div> 	
		<script src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>	
		<script type="text/javascript" src="common.js" ></script>
		<script type="text/javascript" charset="UTF-8">	
			$(function () {				  	 
			});
			
			//添加链接
			mui('#footer').on('tap','a',function(e){
				if(window.localStorage){
					localStorage.removeItem("title");//清除c的值
					localStorage.setItem("title",this.getAttribute('title'));
				}
				mui.openWindow({
					url: this.getAttribute('href'),
					id: 'list'
				});
			})
			
			loadAQI();
			//加载空气质量
			function loadAQI(){				
				var url=Base_URL+"/SiteIndex/querylatestCityHourAQIAPP.json";				
				$.ajax({
               		type: "post",
               		url:url,
               		dataType:"jsonp",
               		scriptCharset: 'utf-8',
               		jsonp: "callback",
               		success: function(data){  
                  		if(data!=null){   	                  								
							$("#AQIValue").html(data[0].AQI);
							$("#quality_level").html(data[0].quality);
							$("#quality_level").addClass('wuranlevel_'+data[0].qualityId);     
							
							$("#wuranwu").html(data[0].primary_pollutant);							
							$("#advice").html(data[0].advice);
							$("#updateTime").html(new Date(data[0].time).pattern("yyyy-MM-dd HH:mm"));						   	
						}              
               		},
	                error:function(){ 	                	
						console.log("获取新闻出现异常");
	                }
            	});
            	            
			}			
		</script>
		
	</body>
</html>
